package org.ithang.test;

import org.apache.shiro.codec.Hex;
import org.ithang.tools.lang.StrUtils;
import org.junit.Test;

public class MHUtils {

	//@Test
	public void test(){
		String s=Hex.encodeToString("good".getBytes());
		char[] cs=Hex.encode("good".getBytes());
		System.out.println("sa="+s);
		for(int i=0;i<cs.length;i++){
			if('6'==cs[i]){
				cs[i]='7';
			}
		}
		System.out.println(cs);
		
		
		s=new String(Hex.decode(s.getBytes()));
		System.out.println("sb="+s);
		
		for(int i=0;i<cs.length;i++){
			if('7'==cs[i]){
				cs[i]='6';
			}
		}
		
		s=new String(Hex.decode(cs));
		System.out.println("sbb="+s);
		
	}
	
	@Test
	public void testa(){
		String s=StrUtils.ehx("have agoodddd time");
		System.out.println("sa="+s);
		s=StrUtils.dhx(s);
		System.out.println("sb="+s);
	}
	
	
}
